struct sDirectionalLight
{
	float3 Color;
	float3 Direction;
};


float3 DirectionalLight_ComputeColor(sDirectionalLight instance, 
	sMaterial material, float3 worldPosition, float3 worldNormal,
	float3 directionToCamera)
{
	float3 lightVector = -instance.Direction;
	
    float diffuseIntensity = saturate(dot(lightVector, worldNormal));
	
	float3 color = diffuseIntensity * instance.Color * material.DiffuseColor;

    //calculate Phong components per-pixel
    float3 reflectionVector = normalize(reflect(instance.Direction, worldNormal));
    
    //calculate specular component
	float3 specular = saturate(instance.Color * material.SpecularColor * pow(saturate(dot(reflectionVector, directionToCamera)), material.SpecularPower));
	
	color += specular;
	
	return  color;
}
